// LineSelectionWhiteboard
//
// This class represents the whiteboard space for one customer-line selection interaction.
// It will be protected by a monitor and will be used by a head customer to select the shortest line
//

class LineSelectionWhiteboard {
  public:
    LineSelectionWhiteboard(int numLines);	// Initialize the LineSelectionWhiteboard object
    ~LineSelectionWhiteboard();	// De-allocate LineSelectionWhiteboard
    
	int getNumLines();					// returns the number of active lines for the simulation
    int getLineLength(int lineNum); 	// returns the length of a specific line
    bool isLineOpen(int lineNum); 		// returns if the current line is open (clerk is on break or not)
	int getNumReshuffle(); 				// returns the number of customers that still need to be reshuffled
    
	void setLineLength(int lineNum, int lineLength); 	// sets the length of a specific line
    void setLineOpen(int lineNum, bool value); 			// sets if the current line is open (clerk is on break or not)
	void setNumReshuffle(int value); 					// sets the number of customers that still need to be reshuffled
	
	void incrementLineLength(int lineNum); 			// increases the given line length by 1
    void decrementLineLength(int lineNum); 			// decreases the given line length by 1
    
	int selectShortestLine();						// returns the index of the shortest length line

  private:
	int numLines;					// number of lines (clerks) that should be allowed to be used
    int* currLineLength;				// current queue for each ticket clerk line
	int* lineOpen;					// int to represent whether line is open [1] or not [0]
	int numReshuffle;					// number of head customers to be reset in case new line opens
};
